package st.business.tepth.business.user.busnumber.workholder.adapter;

import android.graphics.Color;
import android.support.annotation.Nullable;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;

import java.util.List;

import st.business.tepth.R;
import st.business.tepth.business.bean.PersonBean;
import st.business.tepth.manager.UserManager;

/**
 * @author zhangyu
 * @date 2019/3/8
 */
public class TroubleWorkPersonAdapter extends BaseQuickAdapter<PersonBean, BaseViewHolder> {
    public TroubleWorkPersonAdapter(int layoutResId, @Nullable List<PersonBean> data) {
        super(layoutResId, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, PersonBean item) {
        helper.setText(R.id.tv_work_person,
                String.format("%s(%s)", item.getUser_name(), item.getJob_no()));
        if (UserManager.getInstance().getCurrentUserCode().equals(item.getJob_no())) {
            helper.setTextColor(R.id.tv_work_person, Color.parseColor("#ed2f62"));
        } else {
            helper.setTextColor(R.id.tv_work_person, Color.parseColor("#c7d9e5"));
        }
    }

}
